#include<iostream>
#include<cstdio>
#include<ctime>
#include<cstring>
#include<cstdlib>
#include<vector>
#include <algorithm>
#define C    240
#define TIME 10
#define LL long long
using namespace std;
LL PowMod(LL a,LL b,LL MOD){
	LL ret=1;
	while(b){
		if(b&1) ret=(ret*a)%MOD;
		a=(a*a)%MOD;
		b>>=1;
	}
	return ret;
}
LL fac[10000005];
void Get_Fact(LL p){
	fac[0]=1;
	for(int i=1;i<=p;i++)
		fac[i]=(fac[i-1]*i)%p;
}
LL Lucas(LL n,LL m,LL p){
	LL ret=1;
	while(n&&m){
		LL a=n%p,b=m%p;
		if(a<b) return 0;
		ret=(ret*fac[a]*PowMod(fac[b]*fac[a-b]%p,p-2,p))%p;
		n/=p;
		m/=p;
	}
	return ret;
}
int r;
LL ans[200];
struct point{
	LL x, y;
}rec[200];
bool operator<(point a, point b)
{
	if(a.x==b.x)return a.y<b.y;
	else return a.x<b.x;
}
int main(){
	LL n, m, p=110119;
	Get_Fact(p);
	int kase=0;
	while(~scanf("%lld%lld%d",&n, &m, &r )){
		kase++;
		for(int i=1;i<=r;i++)
		{
			scanf("%lld%lld", &rec[i].x, &rec[i].y);
		}
		rec[r+1].x=n, rec[r+1].y=m;
		sort(rec+1, rec+2+r);
		for(int i=1;i<=r+1;i++)
		{
			LL x1=rec[i].x-1;
			LL y1=rec[i].y-1;
			if((x1+y1)%3!=0)
			{
				ans[i]=0;
				continue;
			}
			else
			{
				ans[i]=Lucas((x1+y1)/3, (2*x1-y1)/3, p);
				for(int j=1;j<i;j++)
				{
					LL x2=rec[i].x-rec[j].x;
					LL y2=rec[i].y-rec[j].y;
					if((x2+y2)%3!=0||y2<0)continue;
					ans[i]-=ans[j]*Lucas((x2+y2)/3, (2*x2-y2)/3, p);
					ans[i]=(ans[i]+p*p)%p;
				}
				//    printf("%lld\n", ans[i]);
			}
		}
		printf("Case #%d: %lld\n",kase, ans[r+1]);
	}
	return 0;
}

